<?php
namespace app\index\controller;
use think\Db;
use think\Request;
use think\Url;
use think\Session;
use think\Controller;
use app\index\model\Area as thisModel;


/**
 * 地区模块
 */
class Area extends Base
{
	
	public function index()
	{
		$list = DB::name('cn_prov')->where('is_del = 0 ')->paginate(15);
		$page = $list->render();
		return $this->fetch('Area/index',[
			'list'		=>	$list,
			'page'		=>	$page,
		]);
	}



	public function getCity()
	{
		if (Request::instance()->isPost()) {
			$pcode = Request::instance()->post('pcode');
			$city = DB::name('cn_city')->where('is_del = 0 and pcode = '.$pcode)->select();
		
			return json($city);

		}
	}
}
?>